package com.fast.exception;

import com.fast.enums.CodeEnum;
import com.fast.pojo.AjaxResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.RedisConnectionFailureException;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import redis.clients.jedis.exceptions.JedisConnectionException;

/**
 * @author ruan cai yuan
 * @version 1.0
 * @fileName com.fast.exception.RedisExceptionHandler
 * @description: redis相关异常拦截
 * @since 2024/7/13 下午12:12
 */
public class RedisConnectionException  extends RuntimeException {

    private Integer code;

    public RedisConnectionException(String msg) {
        super(msg);
    }

    public RedisConnectionException(CodeEnum codeEnum) {
        super(codeEnum.getMsg());
        this.code = codeEnum.getCode();
    }
}
